#include "widget.h"
#include "ui_widget.h"
#include <QButtonGroup>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 使用 QButtonGroup 对单选按钮进行分组
    QButtonGroup* g1 = new QButtonGroup(this);
    QButtonGroup* g2 = new QButtonGroup(this);

    // 把单选按钮放到不同组中
    g1->addButton(ui->radioButton);
    g1->addButton(ui->radioButton_2);
    g2->addButton(ui->radioButton_3);
    g2->addButton(ui->radioButton_4);
}

Widget::~Widget()
{
    delete ui;
}

